package Levels 
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import Objetos.Heroi;
	import Objetos.Inimigo;
	import Objetos.Parede;
	/**
	 * ...
	 * @author ...
	 */
	public class Level extends MovieClip
	{
		protected var MC_Heroi           :Heroi;
		protected var MC_Inimigo         :Inimigo;
		protected var MC_upgrade         :MovieClip;
		
		protected var _gameconstructor   :MovieClip;
	    protected var fase1              :MovieClip;
		
		public static var AR_Heroi:Array = new Array()
		public static var AR_Parede:Array = new Array()
		
		public function Level() 
		{
			
		}
		
		public function desenharTela():void
		{
			_gameconstructor
			Main.getInstance().MC_tela.addChild(_gameconstructor)
			
			MC_Heroi = new Heroi;
			MC_Heroi.x = 100;
			MC_Heroi.y = 200;
			Main.getInstance().MC_tela.addChild(MC_Heroi)
			Level.AR_Heroi.push(MC_Heroi)
			
			MC_Heroi = new Heroi;
			MC_Heroi.x = 300;
			MC_Heroi.y = 400;
			Main.getInstance().MC_tela.addChild(MC_Heroi)
			Level.AR_Heroi.push(MC_Heroi)
		}
		
		public function desenharArray():void
		{
			for (var m:uint = 0; m < _gameconstructor.numChildren; m++)
			{
				var mc:Object = _gameconstructor.getChildAt(m);
				
				if (mc is Parede)
				{
					AR_Parede.push(mc);
				}
			}
		}
		
		public function colidirParede():void
		{
			for (var i:uint = 0; i < AR_Heroi.length; i++)
			{
				if (AR_Heroi[i].hitTestObject(Fase1))
				{
					MC_Heroi.velocidadeHeroi = 0
					
				}
			}
		}
		
	}
	

}